FROM python:3.13.2
#FROM python:3.13.2
# 设置镜像的时区为上海
ENV TZ=Asia/Shanghai \
    DM_HOME=/code/libs/dpi \
    LD_LIBRARY_PATH=/code/libs/dpi

# 更新apt源
#RUN echo '\
#deb http://mirrors.aliyun.com/debian/ buster main non-free contrib\n\
#deb http://mirrors.aliyun.com/debian-security buster/updates main\n\
#deb http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n\
#deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n\
#deb-src http://mirrors.aliyun.com/debian-security buster/updates main\n\
#deb-src http://mirrors.aliyun.com/debian/ buster main non-free contrib\n\
#deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib\n\
#deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib\n\
#' > /etc/apt/sources.list
## 安装软件
#RUN export C_FORCE_ROOT="true" # 设置celery全局变量
RUN apt update && apt install -y vim && apt install -y openssh-server

RUN mkdir /var/run/sshd
RUN echo 'root:123456' | chpasswd
RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
# 开放22端口
EXPOSE 22

COPY ./requirements.txt /code/requirements.txt
# 安装python环境依赖包
RUN pip install --upgrade pip -i https://mirrors.aliyun.com/pypi/simple/
RUN pip install --no-cache-dir -r /code/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/

COPY . /code/
RUN mkdir /code/logs



WORKDIR /code
# 启动命令
#CMD /usr/local/bin/gunicorn run:app -c /code/socket_config.py --preload --access-logfile -
#CMD /usr/local/bin/gunicorn socket_manager:app -c /code/apps/init_websocket/socket_config.py --preload --access-logfile -
CMD sh /code/start_server.sh

# docker run -idt --name ai-sks -p 8000:8000 -e DM_HOME=/code/libs/dpi -e LD_LIBRARY_PATH=/code/libs/dpi --restart=always --privileged=true -v /root/data_center_zbzq:/code arm_zbzq_center:0.0.1 sh /code/start_server.sh